package com.ls.task.dal.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.ls.fw.data.rdb.impl.mybatis.mapper.entity.Example;
import com.ls.task.dal.dao.SysTaskDao;
import com.ls.task.dal.model.SysTask;
import com.ls.task.dal.vo.SysTaskVo;
import com.ls.task.dal.service.SysTaskService;
import com.ls.fw.data.rdb.impl.dao.EntityDao;
import com.ls.fw.data.rdb.impl.service.EntityServiceAdapter;


/**
 * 
 * @author ls
 * 2016年08月18日 09时49分16秒
 */
@Service("sysTaskService")   
public class SysTaskServiceImpl extends EntityServiceAdapter<SysTask,SysTaskVo,java.lang.Long>  implements SysTaskService{
	
    private SysTaskDao sysTaskDao = null;
   
    @Resource
    public void setSysTaskDao(SysTaskDao sysTaskDao) {
		this.sysTaskDao = sysTaskDao;
    }
 
	
	@SuppressWarnings("unchecked")
	@Override
	public <D extends EntityDao<SysTask, SysTaskVo,java.lang.Long>> D getEntityDao(){
		return (D) sysTaskDao;
	}
	
	@Override
	public List<SysTask> selectByExample(Example example) {
		return this.sysTaskDao.getMapper().selectByExample(example);
	}


	@Override
	public SysTask selectOneByExample(Example example) {
		return this.sysTaskDao.getMapper().selectOneByExample(example);
	}

	@Override
	public SysTask selectOne(SysTask record) {
		return this.sysTaskDao.getMapper().selectOne(record);
	}


	@Override
	public List<SysTask> select(SysTask record) {
		return this.sysTaskDao.getMapper().select(record);
	}


	@Override
	public int deleteByExample(Example example) {
		example.getMainCriteria().andEqualTo(SysTask.Columns.canDelete.property(), true);
		return this.sysTaskDao.getMapper().deleteByExample(example);
	}


	@Override
	public int updateByExampleSelective(SysTask record,
			 Example example) {
		example.getMainCriteria().andEqualTo(SysTask.Columns.canUpdate.property(), true);
		return this.sysTaskDao.getMapper().updateByExampleSelective(record, example);
	}

	@Override
	public int count(Example example){
		return this.sysTaskDao.getMapper().selectCountByExample(example);
	}
}
